Interface and method of interfacing between a parametric modelling unit and a polygon based rendering system

ABSTRACT

An interface for use in a 3-d graphics system comprising a parametric modelling unit for modelling objects as high order surfaces, and a polygon based rendering system for rendering polygon modelled objects for display. The interface comprises an input for receiving data and a subdivision unit coupled to the input for processing the data. The interface includes a converter coupled to the subdivision unit for determining from leaf patch data a first plurality of values representing vertices of tessellating polygons describing the leaf patch, and for determining from sub-leaf patch data a second plurality of values representing the vertices of tessellating polygons describing the sub-leaf patch. The interface also has a combiner, coupled to the converter, for combining the values to form leaf polygon data defining the polygon vertices at a first subdivision level, and an output coupled to the combiner for outputting the leaf polygon data.

CROSS REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. Ser. No. 10/435,759, filedMay 9, 2003 now abandoned, and entitled “INTERFACE AND METHOD OFINTERFACING BETWEEN A PARAMETRIC MODELLING UNIT AND A POLYGON BASEDRENDERING SYSTEM”.

FIELD OF THE INVENTION

This invention relates to an interface for use in a 3-d graphics systemcomprising a parametric modelling unit and a polygon based renderingsystem.

BACKGROUND TO THE INVENTION

Traditional 3D rendering systems use a mesh of polygons (usuallytriangles) to model the objects within a scene. Triangles have theadvantage that they are of a simple form, and it is therefore relativelyeasy to perform operations such as transformation, lighting, texturingand rasterization on them in order to produce an image for display.

A known alternative to modelling objects using a mesh of polygons is tosegment the object into areas and fit a number of curved, high ordersurfaces, frequently termed patches, to the different areas of theobject being modelled. These patches are generally defined as parametricsurfaces with the surface shape governed by a grid of control points. Anadvantage of using high order surfaces is that the set of control pointsusually requires a much smaller amount of data to represent a particularmodel than the equivalent polygon mesh. High order surfaces are alsogenerally easier to manipulate when animating an object which ischanging in shape. A major disadvantage of modelling using high ordersurfaces is that it introduces added complexity in the rasterizationstage of the rendering system.

It is also known to use high order surfaces for the modelling stage andto convert the surfaces to a series of tessellating triangles beforeperforming processing stages such as rasterization. This combined methodbenefits from the advantages of using curved surfaces without addingcomplexity to the rasterization stage but requires a suitable interfaceto process the surface patch data to form polygon based data. Twomethods are commonly employed in the tessellation process for convertingthe curved surface to a series of polygons: either forward differencingor recursive subdivision. The present invention is derived from therecursive subdivision method.

In the parametric modelling stage of a combined 3-D graphics system(i.e. one that combines a tessellation stage to produce polygons for thelatter rendering stage), a plurality of curved surfaces patches arefitted to the surface of the object to define areas of the object. Anumber of different standards for defining the behaviour of such patcheswith respect to their defining control points are known. One suchstandard is Bezier patches, for example see “Advanced Animation andRendering Techniques” pp 66-68 by Watt & Watt or “Computer GraphicsPrinciples and Practice” pp 471-530 by Foley Van Dam et al. Methods oftransforming the control points corresponding to one format of patch tonew positions corresponding to a different patch type so that the finalsurfaces are identical are also known. These patches are often ofbicubic order.

Of the common parametric patches, there are two main variations. Thefirst is the family of ‘standard’ mpm-rational surface patches, whilethe second is the super-set of rational patches. Rational patches havecertain modelling advantages over the simpler non-rational variety butcan be slightly more complex to process in some respects. Both types ofpatches are well described in the previous two references, however tosimplify description of the embodiment, the following summary ispresented. For a non-rational parametric surface, the 3D position can bedescribed as:

${{\overset{\_}{B}}_{{non}\text{-}{rational}}\left( {s,t} \right)} = \begin{pmatrix}{x\left( {s,t} \right)} \\{y\left( {s,t} \right)} \\{z\left( {s,t} \right)}\end{pmatrix}$

where each of x(s,t), y(s,t), and z(s,t) are scalar parametricpolynomials of the same degree, and 0≦s,t≦1. In the case of a bicubic(i.e. the product of two cubics) Bezier surface the polynomial is ofdegree 6. The Bezier equations and the respective x, y, and z componentsof the surface's control points define the shape of the surface.

A non-rational surface extends the definition by introducing a fourthpolynomial w(s,t) with a corresponding additional positive “w” value ineach of the control points. The surface position is then defined by:

${{\overset{\_}{B}}_{rational}\left( {s,t} \right)} = {\frac{1}{w\left( {s,t} \right)}\begin{pmatrix}{x\left( {s,t} \right)} \\{y\left( {s,t} \right)} \\{z\left( {s,t} \right)}\end{pmatrix}}$

It is also well known in the art (see previous references) that thepopular types of parametric surfaces patches can be convenientlyexpressed in matrix form. For example, a bicubic Bezier patch, B_(bez)(S,t) can be expressed as:

${{\overset{\_}{B}}_{bez}\left( {s,t} \right)} = {\left\lbrack {s^{3}s^{2}s\; 1} \right\rbrack{{QPQ}^{T}\begin{bmatrix}t^{3} \\t^{2} \\t \\1\end{bmatrix}}}$

-   -   where Q is a matrix of scalar constants and P is the matrix of        control points for the surface

$Q = {{\begin{bmatrix}{- 1} & 3 & {- 3} & 1 \\3 & {- 6} & 3 & 0 \\{- 3} & 3 & 0 & 0 \\1 & 0 & 0 & 0\end{bmatrix}P} = \begin{bmatrix}{{\overset{\_}{P}}_{00}{\overset{\_}{P}}_{01}{\overset{\_}{P}}_{02}{\overset{\_}{P}}_{03}} \\{{\overset{\_}{P}}_{10}{\overset{\_}{P}}_{11}{\overset{\_}{P}}_{12}{\overset{\_}{P}}_{03}} \\{{\overset{\_}{P}}_{20}{\overset{\_}{P}}_{21}{\overset{\_}{P}}_{22}{\overset{\_}{P}}_{03}} \\{{\overset{\_}{P}}_{30}{\overset{\_}{P}}_{31}{\overset{\_}{P}}_{32}{\overset{\_}{P}}_{03}}\end{bmatrix}}$

Note that P is numbered as P_(ST).

Conversion of the patches to tessellating triangles via the recursivesubdivision method is achieved by initially dividing each patch into twosub-patches across either one of its two parameter dimensions (i.e. s ort). This is shown in FIGS. 1 a and 1 b, in which the patch, with controlpoints, has been portrayed in its parameter space. Each of thesub-patches can then be further sub-divided until the correct level ofsub-division is achieved. Once this has been achieved, the resultingsub-patches are each treated as non-planar quadrilaterals, and a setpattern of triangles is superimposed onto the sub-patches, the verticesof the triangles calculated, and the triangles output.

FIG. 2 is a schematic showing conceptual processing of a patch bysubdivision with three levels of subdivision applied. From FIG. 2, itcan be seen that the processing takes the form of a binary treeprogressing from the original, or “root”, patch, through intermediatelevels of patches to end-point patches termed “leaf” patches. Each leafpatch is used to generate the vertices defining the tessellatingtriangles required for the rasterization stage of rendering.

In the known system of recursive sub-division, tessellation istraditionally implemented on a CPU as a large number of calculations arerequired for each stage. Examining the series of calculations involvedshows that, when using a CPU, it is efficient to store the intermediateresults on a stack, as the same intermediate result is used on a numberof the paths to the leaf patches. Use of the stack therefore minimisesthe number of calculations performed. We have appreciated that for ahardware implementation this is not practical for two reasons: internal(i.e. on-chip) storage is expensive and the retrieval of large amountsof externally stored data can cause a bottleneck in the performance ofthe system.

The present invention in a first aspect aims to ameliorate theseproblems. It provides an interface for converting parametric modelleddata to polygon based data using recursive sub-division in a way whichprovides high computational performance whilst minimising memory andmemory bandwidth usage.

According to the invention in a first aspect, there is provided aninterface according to claim 12. Preferred features of the first aspectof the invention are defined in dependent claims 13 to 16.

There is also provided a method of interfacing between a parametricmodelling unit and a polygon based rendering system according to claim16. Preferred method steps are defined in dependent claims 17 to 19.

A second problem which occurs when interfacing between parametric dataand polygon based data in a combined graphics system is that differentlevels of subdivision may be required to convert parametric datarelating to a first patch and parametric data relating to a secondpatch, where the first and second patches represent adjacent areas ofthe object being modelled. Patches which define highly curved surfacesmust be more highly subdivided than patches which represent a flattersurface when converting the parametric data to polygon based data if thebenefits of parametric modelling are not to be lost. If conversion ofadjacent patches is not constrained to apply the same level ofsubdivision to each patch, then cracks can appear in the modelled objectbecause the surface with the higher level of subdivision has extrasample points and thus potentially a slightly different shape. Theproblem of cracking is illustrated in FIG. 4.

One solution to the problem of cracking is to use the same level ofsubdivision on all patches. However, this results in some patches beingexcessively subdivided when they could be tessellated adequately at aless divided level and does not target the processing to the areas whereit is necessary to produce adequate results.

Another solution is to process each patch to a level of subdivisionsufficient to represent the surface adequately, and to then insert aso-called “stitching mesh” between adjacent surface patches which havedifferent subdivision levels. The stitching mesh thus covers anypotential cracks as shown in FIG. 5 a. In the diagram, two adjacentpatches are subdivided to different levels—one uses 2×4 sub-patcheswhile the other is represented by no subdivisions, i.e. a singlequadrilateral. The ‘abutting’ contour on the 2×4 patch consists ofvertices, A, B, C, D, & E, while the equivalent for the 1×1 subdivisionconsists of the edge AE. To prevent a gap in the surface from appearing,the additional triangles, ABC, ACE and CDE are created.

Unfortunately, such connecting meshes may introduce abrupt changes insurface direction. We have also appreciated that stitching the edges ofadjacent patches together is computationally intensive and requires thestitching mesh to be regenerated as the subdivision level changes.

Clark [“A Fast Scan Line Algorithm for Rendering Parametric Surfaces”.Computer Graphics 13(2), 289-99] proposed an alternative technique whicheven permits different levels of subdivision within each patch. As partof this method, the cracking problem, had to be ‘solved’. Clark'ssolution is to deliberately ‘flatten’ the edges of higher subdivisionregions where they meet lower subdivision regions. This is shown in FIG.5 b. The ‘shared’ boundary between the high-subdivision region and thelow-subdivision area has been ‘flattened’ on the high subdivision regionso that it mathematically matches the boundary of the low-subdivisionregion. Comparing this to the approach in FIG. 5 a, it can be seen thatthe vertices, B, C, & D now lie on the line AE.

Although this scheme is mathematically correct, it has a subtle flaw.Computer graphics hardware has limited precision and is unable torepresent exact polygon vertex locations. It is therefore frequentlyimpossible to exactly place a flattened vertex on the shared boundary.This leads to problems caused by “T-Joints”, as well known in the art.This is illustrated in FIG. 5 c, wherein an inaccuracy causes a verysmall gap to appear. Although this gap is typically tiny, it can stillbe visible in the rendered images as sets of semi-random pixel holeslying along the edges of the otherwise abutting triangles. As the imageis animated, these will ‘twinkle’ on and off and are easily seen.

We have appreciated that these T-Joints could be fixed by againintroducing stitching polygons, however this is a rather inefficientapproach since such polygons are tiny and the ‘set-up’ costs involved inpolygon rendering would be better utilised on more significantly sizedpolygons.

Yet another approach, as used by Pixar's Renderman system, is tosubdivide the patches until the resulting polygons are smaller than apixel. These micro-polygons can then be treated as ‘points’. Thismethord generates vast amounts of data and is not really suitable forreal-time rendering.

The options for crack-free subdivision in the current art can thus besummarised as follows:

1) Subdivide all patches of the model to the same subdivision level.This is simple but wasteful of resources.

2) Within each patch subdivide uniformly, and then use stitchingpolygons to hide gabs between patches divided non-uniformly. It is notideal as the stitching polygons are additional costs and can induceabrupt changes in direction (as seen in FIG. 5 a).

3) Use Clark's method, allowing non-uniform subdivision even withinpatches, but suffer from T-Joint problems.

4) Apply further stitching polygons to Clark's method.

5) Subdivide the mesh into micro-polygons.

We have appreciated that allowing non-uniform subdivision along patchedges is desirable since it allows the joining of different patcheswithout cracking at the joints. It is also desirable to allownon-uniform subdivision within patches, as is possible with Clark'smethod, as this can allow a more efficient use of polygons as a gradualtransition from a high subdivision edge on one side of a patch to a lowsubdivision edge on the opposite would require fewer polygons than in asystem where the patch is internally subdivided uniformly. We have alsoappreciated that a system which does not need stitching polygons, eitherinternally or on the boundaries, and also does not introduce T-Joints ishighly desirable.

The present invention in a second aspect therefore supports “irregularpatch” processing, that is processing of patch data to differentsubdivision levels in different subdivision directions within the patchbut avoiding the problems with Clark's scheme. By forming differentnumbers of vertices on different edges of the “irregular” patch, we haveeliminated the need for stitching meshes to prevent cracking between thetessellated patches that are modelling adjacent areas of objects.Supporting irregular tessellation allows adjacent edges of adjoiningpatches to have the same number of polygon vertices without affectingthe level of subdivision of the patch for the remaining edges. Anexample, showing the boundary of two unequally subdivided patches, isgiven in FIG. 13 b.

According to the present invention in a second aspect, there is providedan interface according to claim 8. Preferred features of the secondaspect of the invention are detailed in dependent claim 9. There is alsoprovided a method of interfacing between a parametric modelling unit anda polygon based rendering system according to claim 10.

Irregular levels of sub-division are supported by automaticallygenerating a mesh from the final sub-patch that has a suitable number ofvertices along each edge of the quadrilateral. This allows simplejoining of polygonised patches without cracks appearing.

A further problem with known interfacing techniques is so-called polygonpopping. For the interfacing of different patches it has been assumedthat each edge of every patch has its own subdivision control value. Toallow the smooth animation of objects as the level of subdivisionchanges, these values are assumed to take floating point or at leastcontain fractional parts. Polygon popping is a term used to describe thesudden movements in the points of the tessellated polygons that canoccur when a small fractional change in the subdivision control valuecauses an extra step of processing (i.e. an extra binary subdivision ofthe patch) to be performed. Although the edge subdivision control valuemay take any value, the preferred tessellation technique is constrainedto perform binary patch subdivision to the next nearest power of 2. Thusincreasing the subdivision ratio even a small amount may cause theactual level of subdivision to increase dramatically. For example if thesubdivision value specified for each edge is 4, then subdivision resultsin 16 leaf patches. If the subdivision value for each edge is increasedfrom 4 to 4.1, the next larger power of 2 is 8 and the resultingsubdivision gives rise to 64 leaf patches. Thus many new triangles haveappeared in the object. Unless this process is well controlled it causesundesirable visual effects in the animation as shown in FIG. 3.

In FIG. 3 a, the curved surface has been subdivided into twoquadrilateral regions. The ‘front-most’ curved edge of the patch is thusapproximated by the line segments AB and BC. In FIG. 3 b, the level ofsubdivision is increased (in one dimension only) so that along the frontedge, two new points, D & E, have been generated. The front edge of thepatch is then represented by the line segments AD, DB, BE and EC. Thechange in shape from ABC to ADBEC is relatively large, and the newpoints D & E can be said to have jumped or “popped” into view. This ismost readily seen in this example with point E which will have appearedto have jumped from the position E′.

The present invention, in a third aspect, aims to ameliorate the visualproblems associated with polygon popping.

According to the present invention in a third aspect there is providedan interface according to claim 1.

Preferred features of the third aspect of the invention are defined independent claims 2 and 3. There is also provided a method of interfacingbetween a parametric modelling unit and a polygon based rendering systemaccording to claim 4. Preferred method steps are defined in dependentclaims 5 to 7.

The present invention in a third aspect produces a smoother lookinganimated image when changing levels of detail of a model using highorder surfaces. Preferably it uses a weighted blend between the linearand cubic subdivision of the final tessellated leaf-patch. The weightingfactor for this blend is preferably determined by the ratio between therequired subdivision value and next smaller power of 2.

When lighting and shading operations are applied to surfaces in 3-Dgraphics, there is usually a requirement that the surface normal at apoint, i.e. a vector perpendicular to the surface at that location, beknown. For the purposes of shading a tessellated surface, surfacenormals need only be computed at the computed triangle verticles.

As descrived by Watt and Watt, Forley et al, and Farin, [“Curves andSurfaces for CAGD. A Practical Guide”. 4^(th) Edition, Academic Press,ISBN 0-12-249054-1, pp 244-247], the standard way to obtain the normalat a point is to calculate two (linearly independent) tangent vectors atthat point and take their cross product. If desired, the result canlater be converted into a unit computing the first partial derivativesof the surface with respect to the s and t parameters.

Without loss of generality, if we restrict the surface normalcalculations to only be done at the corner points of patches, thennon-rational Bezier surfaces have the very convenient property that thedifferences between a corner control point and each of its two nearestedge control points are scalar multiples of the respective first partialderivatives. This is shown in FIG. 19 wherein ‘Tangent S’ coincides withthe difference of corner point P₀₀ and its neighbour control point P₁₀,while ‘Tangent T’ coincides with the difference between the corner andcontrol point P₀₁.

A number of systems use this fact (in addition to repeated subdivision)to compute the normals at various locations on the patch.

Unfortunately, this calculation can frequently fail. The requirement isthat the tangent vectors are linearly independent and control points ofthe Bezier patch, especially those neighbouring the corner points, cansometimes be coincident. This means that one or both of the firstpartial derivates may be zero, resulting in an incorrect normal. Suchsurfaces patches are often referred to as ‘degenerate’, and some systemsmay consider them to be ‘illegal’. This is rather unfortunate as suchsurface arrangements of control points are often needed to modelcompletely valid shapes and can easily be generated by modellingsoftware packages.

One known and rather pragmatic solution is that of evaluating thesurface at two points slightly offset from the corner in the s and tparameters. The two tangent vectors are then approximated by taking thedifferences between these computed points and the patch corner. Thiswill usually provide an adequate result, but is costly in terms ofadditional calculation.

By referring back to the definition of a tangent vector and applyingcalculus, one can see that the 2^(nd) partial derivative can be employedif the first is zero. Watt and Watt [“Advanced Animation and RenderingTechniques. Theory and Practice”. ACM Press. ISBN 0-201-54412-1]demonstrate, again for non-rational Beziers patches, that in thissituation the difference between the corner control point and thesubsequent multiple of the 2^(nd) partial derivative. Again referring toFIG. 19, if P₀₁ and P₀₀ were coincident, for example, then thedifference of P₀₂ and P₀₀ would yield a potential tangent. If this werealso zero, a similar process can be employed for the 3^(rd) partialderivative by taking the difference with P₀₃.

Unfortunately, even this approach can fail. All the points along an edgeof patch may be coincident, as may occur when a patch is modelling anoctant of a sphere and the patch has become ‘triangular’. In thisparticular situation a 2^(nd) partial derivative may be chosen. Farinalso describes an even subtler problem: although non-zero partialderivatives in s and t might exist, in some situations they can beparallel. The cross product will then give a zero, and hence invalid,normal. Farin describes the solution for one particular case.

In a fourth aspect, the invention will present a method of computing thesurface normal which is not only robust but also efficiently computesthe normals for Rational Bezier surfaces.

Embodiments of the invention will now be described in more detail inaccordance with the accompanying drawings in which:

FIG. 1 a is a schematic diagram showing the subdivision of an n−1^(th)level patch in t to form a top half n^(th) level subpatch and a bottomhalf n^(th) level subpatch (These are shown physically separated in thediagram for clarity.);

FIG. 1 b is a schematic diagram showing the subdivision of an n−1^(th)level patch in S to form a left half n^(th) level subpatch and a righthalf n^(th) level subpatch;

FIG. 2 is a schematic diagram showing the possible choices ofsubdivision options of a root patch to intermediate patches andultimately to leaf-patches for a patch being subdivided into 8 leafsub-patches, the choice of S or T subdivision direction at each stagebeing determined by supplied subdivision parameters;

FIG. 3 a is a diagram showing a curved surface approximated by a firsttessellation process producing vertices ABC along the ‘front edge’,while FIG. 3 b shows the same surface approximated by a secondtessellation process producing vertices ADBEC along the front edgeshowing the relatively large change in shape between tessellationprocesses resulting in polygon popping;

FIG. 4 illustrates the problem of cracking when adjacent patches aresubdivided to different subdivision ratios;

FIG. 5 a is a stitching mesh used by known polygonisation systems toovercome the problem of cracking;

FIG. 5 b shows Clark's approach to stopping the cracking problem;

FIG. 5 c shows the “T-Joint” problem in computer graphics;

FIG. 6 is a schematic diagram showing a preferred embodiment of aninterface;

FIG. 7 is a schematic showing the calculation stages of a subcalculationunit;

FIGS. 8 a, 8 b, 8 c and 8 d show respectively the indexing of rows andcolumns of patch data for top half subdivision in t, bottom halfsubdivision in t, left half subdivision in S and right half subdivisionin S using the calculation of FIG. 7;

FIG. 9 is a schematic of a two stage subdivision unit;

FIG. 10 is a flow chart showing the operation of the control unit;

FIG. 11 is a preferred tessellation pattern;

FIG. 12 is an alternative tessellation pattern;

FIG. 13 a is a tessellation pattern for a right edge irregularleaf-patch;

FIG. 13 b shows the junction of the irregular patch from 13 a and ahigher subdivision level patch;

FIG. 14 is a schematic showing generation of fan patches for estimatingthe additional vertices of the irregular patch of FIG. 13 a;

FIG. 15 is a flow chart showing operation of the control unit during fanpatch processing;

FIG. 16 is a schematic showing the correspondence between the controlpoints P00, P30, and P33 of a leaf-patch and the vertices V0, V2, V6 andV4 of the tessellating triangles;

FIG. 17 is a schematic showing the generation of a combined value forvertices V1, V3, V5, V7 and V8;

FIGS. 18 a and 18 b are diagrams relating to which vertices are used inthe calculation of the centre vertex V8 for different leaf-patches;

FIG. 19 illustrates one example of the behaviour of tangent vectors atthe corners of a non-rational bicubic Bezier Patch;

FIG. 20 shows the additional partial subdivision steps applied to a(regular) leaf patch to generate control points suitable forconstructing the surface normals at the 9 “tessellation” vertices (i.e.those shown in FIG. 11);

FIG. 21 shows the subset of control points of a rational bicubic Bezierpatch used by the invention to generate the surface normal for aparticular corner point of the patch;

FIG. 22( a) describes the steps taken to produce the required controlpoints for the generation of 9 vertex normals for a tessellated leafpatch;

FIG. 22( b) further describes a part of this normal generation process;

FIG. 23 describes the steps/apparatus used in the derivation of acandidate tangent vector in one parameter dimension at the corner of arational Bezier patch;

FIG. 24 describes the steps/apparatus used to combine three candidatetangent vectors at a patch corner to produce a surface normal.

DESCRIPTION OF PREFERRED EMBODIMENTS OF THE INVENTION

The interface is intended for use in a 3-d graphics system using aparametric modelling unit and a polygon based rendering system to allowthe parametric data modelling the object to be converted to a formatwhich can be used by the polygon based rendering system to process thedata for display.

FIG. 6 is a block diagram of the interface. The interface 10 includes aninput buffer 12, format converter 14, recursion buffer 16, subdivisionunit 18, weighting processor 20, direction processor (or surface normalgeneration unit) 24, output buffer 26 and control unit 22.

In parametric modelling units, patches are used to define a surface. Atypical, bicubic patch is defined by 16 control points. Each controlpoint is an N-dimensional vector defines a number of elements (usuallyincluding (xyzw) position, colour, and texture mapping information).Typically for 3D graphics systems, the data for each patch is grouped bycontrol point and it is this control point grouped data which are inputto the interface 10 via the input buffer 12. The subdivision unitrequires the data to be grouped by element rather than by control point.

The input buffer 12 takes the control point grouped data, rearranges thedata to the element-wise format required by the subdivision unit 18 andoutputs the data to the format converter 14.

The subdivision unit of the interface 10 is designed to process aparticular standard of patch known as a Bezier Bicubic Patch. Otherpatch formats, for example based on Catmull-Rom and B-Splines, are alsoused in 3D modelling. To enable the interface 10 to process other patchformats, a format converter 14 is provided. The format of the patchrepresented by the element-wise data output by the input buffer 12 isdetermined. If the format of the data is not Bezier bicubic, the formatconverter 14 converts the data to Bezier bicubic format via a series ofoptimised matrix multiplies. Methods of converting between various patchformats are known in the field of 3-d graphics and are not describedhere. The format converter 14 maintains a library of conversionalgorithms and applies the appropriate conversion algorithm to the datato covert it to Bezier bicubic format.

The recursion buffer, or store, 16, provides storage for datacorresponding to two patches: the root patch and an intermediate patch.The root patch must be accessed multiple times during the subdivisionprocess because it is the starting point to each intermediate patch.Storing intermediate patch data in the recursion buffer 16 reduces thedata transfer in the interface, improving efficiency and reducingprocessing time. This area of the recursion buffer 16 effectivelyprovides a working area for intermediate results.

Patch subdivision to the required level is performed by the subdivisionunit 18. The input to the subdivision unit 18 is fed from the recursionbuffer 16. Subdivision is split into four categories: subdivision in ttaking the top half of the patch, subdivision in t taking the bottomhalf of the patch, subdivision in s taking the left half of the patchand subdivision in s taking the right half of the patch.

A Bezier patch has 16 control points and the control point data isarranged in a 4×4 matrix. Subdivision from a first level patch, n−1, tothe next level sub-patch, n, in any category is achieved by applying thefollowing recursive equations to the patch data:A _(i) ^(n) =A _(i) ^(n−1);B _(i) ^(n)=(A _(i) ^(n−1) +B _(i) ^(n−1))/2;C _(i) ^(n)=(A _(i) ^(n−1)+2B _(i) ^(n−1) +C _(i) ^(n−1))/4;D _(i) ^(n)=(A _(i) ^(n−1)+3B _(i) ^(n−1)+3C _(i) ^(n−1) +D _(i)^(n−1))/8  Eqn 1

where Ai, Bi, Ci and Di refer to appropriate elements of a 4×4 controlpoint matrix according to the category of subdivision. The way in whichthe element indexing is controlled is described below for each categoryof subdivision.

The above equations are recursive; for example calculation of B_(i) ^(n)requires the previous of A_(i) ^(n−1) and B_(i) ^(n−1). The subdivisioncalculations are performed efficiently by pipelining the operations asshown in FIG. 7 and described below.

FIG. 7 shows a subcalculation unit. The input to the subcalculation unitis 4 control point values A^(n−1), B^(n−1), C^(n−1) and D^(n−1), of ann−1^(th) level patch. A first calculation stage comprises 3 adders 46,48 and 50 arranged in parallel and each coupled to the input and to asecond calculation stage. One of the adders 46 is also coupled to afourth calculation stage.

The second calculation stage comprises 2 adders 52 and 54 arranged inparallel. Each adder is coupled to the output of 2 of the 3 adders ofthe first calculation stage. One adder 52 is coupled directly to thefourth calculation stage. Both adders 52 and 54 are coupled to the thirdcalculation stage.

The third calculation stage comprises a single adder 56 which takes asits input the outputs from both adders 52 and 54 of the secondcalculation stage. The output of the adder 56 is coupled to the fourthcalculation stage.

The fourth calculation stage comprises 3 dividers 58, 60 and 62 arrangedin parallel which respectively divide the output of adder 46 by 2, theoutput of adder 52 by 4 and the output of adder 56 by 8.

The output of the subcalculation unit outputs are control point valuesof the n^(th) level patch, namely A^(n)=A^(n−1), and the outputs of thethree dividers 58, 60 and 62 as B^(n), C^(n) and D^(n) respectively.

The pipelined system achieves high system clock rates.

Calculation of A^(n), B^(n), C^(n) and D^(n) the values of controlpoints in the subpatch from A^(n−1), B^(n−1), C^(n−1), and D^(n−1) thevalues of the corresponding control points in the patch which is beingsubdivided, is performed by the subcalculation unit in a series ofadditions. The first stage of the calculation is to calculate inparallel first stage intermediate values P, Q and R whereP=A ^(n−1) +B ^(n−1)Q=B ^(n−1) +C ^(n−1)R=C ^(n−1) +D ^(n−1)

The second stage is to calculate in parallel second stage intermediatevalues S and T where S=P+Q and T=Q+R.

The third stage is to calculate a third stage intermediate value U,where U=S+T.

In the fourth stage the values V=P/2, W=S/4 and X=U/8 are calculated inparallel and the values A^(n)=A^(n−1), B^(n)=V, C^(n)=W and D^(n)=X areoutputted from the subcalculation unit.

Each subcalculation unit calculates the values of four new controlpoints in the n^(th) level sub-patch. Calculation of each set of fournew control points is independent of the calculation of the other 12control points. Thus, by using four subcalculation units in parallel,the 16 new control points of the n^(th) level sub-patch may becalculated in a minimum number of clock cycles thereby achieving a highthroughput. The outputs of the four subcalculation units are assembledin the output multiplexer (mux) 44 to generate the control point matrixfor the n^(th) level sub-patch.

The subcalculation units are required to work on different elements ofthe 4×4 control point matrix depending on which category of subdivisionis being carried out. However, by including input and outputmultiplexers in the subdivision unit, four identical subcalculationunits may be used to calculate the new control points. The function ofthe input and output muxes will now be described.

Input Mux

The function of the input mux is to allow the rows and columns of then−1^(th) level patch control point matrix to be swapped to control thecategory of subdivision implemented by the subcalculation units.

For subdivision in t, the rows of the control point matrix are indexed Ato D and the columns of the control point matrix 1 to 4 from left toright. The direction of indexing for the rows depends on whether a tophalf patch or bottom half patch is to be generated. To generate a tophalf patch, the rows are indexed starting with A as the top row of thematrix and ending with D as the bottom row of the matrix. Thus the toprow of control points of the nth level top half sub-patch are identicalto the top row of control points of the n−1^(th) level patch. Theremaining three rows of the nth top half sub-patch are related to therows of the control points of the nth level patch as defined in theequation 1 above. Similarly, the bottom row of control points of the nthlevel bottom half sub-patch are identical to the bottom row of thecontrol points of the n−1th level patch and the remaining rows arerelated to the rows of the n−1th level matrix in accordance withequation 1.

FIGS. 8 a and 8 b show the appropriate indexing of a n−1th level patchin order to perform division in t taking the top half sub-patch anddivision in t taking the bottom half sub-patch respectively. Thus, togenerate a bottom half from subdivision in t, the rows of the patch mayfirst be inverted and then processed as for top half sub-patchgeneration forming interim data which must then be arranged to form therequired sub-patch data.

For subdivision in s, the columns of the patch are indexed A to D andthe rows are indexed 1 to 4 from top to bottom. The direction ofindexing for the columns depends on whether a left half sub-patch orright half sub-patch is to be generated. To generate a left halfsub-patch, the columns are indexed starting with A as the left columnand ending with D as the right column of the patch. Thus the left handcolumn of control points of the level left half sub-patch are identicalto the left hand column of control points of the n−1th level patch. Theremaining three columns of the left half sub-patch are related to thecolumns of the control points of the n−1th level patch as defined in theequation 1 above. Similarly, the right hand column of control points ofthe nth level right half sub-patch is identical to the right hand columnof the control points of the n−1th level patch and the remaining columnsare related to the columns of the n−1th level patch in accordance withequation 1.

FIGS. 8 c and 8 d show the appropriate indexing of a n−1th level patchin order to perform division in s taking the left half sub-patch anddivision in s taking the right half sub-patch respectively. Thus, togenerate a left half sub-patch from subdivision in s, the rows andcolumns of the patch may first be swapped and the rearranged patchprocessed as for top half sub-patch generation. Similarly to generate aright half sub-patch from subdivision in s, the rows are inverted thenthe rows and columns swapped. Processing for a top half sub-patchsubdivided in t is performed and the resulting control points rearrangedby the output mux to correspond to the required right half subpatch.

Output Mux

The function of the output mux is analogous to that of the input mux. Itarranges the interim data output by the subdivision unit according tothe category of subdivision to form the required subpatch control pointmatrix. Assuming that the subcalculation unit is set up to perform tophalf subdivision in t, the output of the subcalculation unit must berearranged to produce bottom half subdivision in t and left and righthalf subdivision in s. The output mux assembles the four outputs of thesubcalculation units into a single matrix and reverses the rearrangementcarried out by the input mux to produce the required subpatch controlmatrix.

Once the element-wise control data for the n^(th) level sub-patch hasbeen assembled in the appropriate order, that is as per FIG. 7 a, 7 b, 7c or 7 d according to the category of subdivision, it is eitheroutputted to the weighting processor 20 and direction processor 24 if itrelates to a leaf patch, or returned to the recursion buffer 16 if itrelates to an intermediate patch.

In the interface, the subdivision calculation is implemented as shown inFIG. 9. This implementation of the subdivision architecture has beenfound to be very efficient. A prior-art method presented in Watt & Wattrequires more ‘caling’ steps which can become a significant cost in ahardware floating point implementation. The subdivision unit 18comprises a number of stages. Each stage performs one level ofsubdivision. The second stage subdivision may be bypassed if therequired level of subdivision is reached after processing by the firststage. In the presently preferred embodiment, two stages, a first stage30 and a second stage 32, are implemented in the subdivision unit 18.Inclusion of two subdivision stages has the advantage of increasing theraw calculation performance of the system for a given amount of databandwidth from the recursion buffer. The number of stages may be changedto provide the required size/performance trade-off in the final system.Each stage consists of an input multiplexer 34, four subcalculationprocessors 36, 38, 40 and 42 and an output multiplexer 44.

In the first stage, data for an element of the patch is read from therecursion buffer 16. The input and output muxes 34 and 44 respectivelyallow the rows and columns of the matrix of elements to be rearrangedcontrolling the calculation which is performed. The calculations optionsare

-   -   Subdivide in s, output left half    -   Subdivide in s, output right half    -   Subdivide in t, output top half    -   Subdivide in t, output bottom half    -   Bypass

The input mux 34 rearranges the matrix according to the category ofsubdivision required and passes four control points of the n−1th levelpatch to each subcalculation unit for processing. The output of eachsubcalculation unit is fed to the output mux 44 which assembles theoutputs of the subcalculation unit and arranges the matrix into therequired sub-patch according to the category of subdivision required.The output from the output mux 44 of stage 1 is processed as the inputto the input mux 34 of stage 2. The stage 2 output is either fed back tothe recursion buffer 16, or fed on to the following calculations stagesif a leaf patch has been reached.

The use of the input and output muxes eliminates the need for fourseparate blocks of subcalculation units and therefore minimises thenumber of component parts of the curved surface subdivision system.

The operation of the subdivision unit 18 is controlled by a series ofinstructions presented from the control unit 22. The control unit 22operates on the algorithm presented in the flowchart of FIG. 10. Thecontrol unit 22 causes a root patch to be taken from the recursionbuffer 16 and passed to the input mux 34 of the first stage.

It is assumed that the assignment of the four patch subdivision levels,corresponding to the four edges of the patch, have been computedexternally either in software or hardware.

The control unit 22 determines whether subdivision in the t dimension isrequired by testing the subdivision values of the left and right handedges of the root patch control matrix. If neither the left nor theright hand edge value lies between the values 1.0 and 2.0, subdivisionof the patch in t is required. The left and right hand edge values aredivided by 2. A command to divide in t is sent by the control unit 22 tothe subdivision unit 18 causing the appropriate rearrangement of thedata by the input mux and arrangement of the interim data by the outputmux. Having divided in t it is then necessary to calculate newsubdivision values for the top and bottom edges. If top half subdivisionis carried out then the top row of the control matrix is unchanged andthe top value for the top half sub-patch is carried over from theundivided matrix. However, top half subdivision results in the bottomrow of the sub-patch differing from that of the undivided matrix. Thebottom value must therefore be updated. The new value is calculated aseither the average or preferably the geometric mean of the top andbottom values of the undivided matrix. The geometric mean is preferablebecause it more usefully distributes the levels of subdivision acrossthe patch. For bottom half subdivision, it is the top value of thesubdivided matrix which must be calculated whilst the bottom edge valueis carried over from the undivided matrix. The top edge value iscalculated in the same way as that of the bottom edge value for top halfsubdivision.

The control unit 22 continues subdivision in the t dimension until theexit condition is met, at which point processing advances to the sdimension. The exit condition is met when either the left or the righthand edge value lies between 1.0 and 2.0 indicating that furthersubdivision in t of the entire patch is not required. Further processingof the patch may however be required if the resulting patch isirregular. Processing of irregular patches is described later.

Processing in the s dimension proceeds in a similar way but with the topand bottom edge values being tested to determine whether subdivision ins is required. New right and left edge values are calculated for theleft half subdivision and right half subdivision respectively. The newright and left edge values are calculated as either the average orpreferably the geometric mean of the left and right edge values of theundivided matrix. Once the s dimension exit condition is met, t isre-checked and the processing loops as required. The exit condition fors subdivision is met when either the left or right edge value is between1.0 and 2.0. As with t subdivision, further processing of the resultingpatch may be necessary if it is irregular.

Once both s and t exit conditions have been met the root or intermediatepatch has been processed to a first level of subdivision and hasgenerated data representing an end-point, leaf patch. A command is thensent from the control unit 22 to the subdivision unit 18 to output itsleaf patch data.

The control unit 22 monitors the number of passes through its algorithmthat have been completed. On the first pass, the control unit 22 sends acontrol signal to the subcalculation unit 18 to force the top halfsub-patch to be calculated for division in t, and the left halfsub-patch to be calculated for division in s. A history of the commandssent to the subdivision unit 18 from the control unit 22 is recorded.This command history is then used on subsequent passes to ensure thatall the other sequences are exercised. The final pass of the controlunit algorithm has been executed when dividing in t always takes thebottom half sub-patch as output, and dividing in s always takes theright half sub-patch as output.

Processing of Regular Leaf Patches

If the leaf patch has each of its final edge values between 1.0 and 2.0,then the leaf-patch is said to be regular. The regular leaf patch isprocessed to generate nine vertices of a grid of triangles arranged tocover the patch as shown in FIG. 11 by a converter. Preferably theconverter is incorporating processer 20. The tessellating trianglescover a square with three vertices set out in a regular array on eachside of the square and the ninth vertex positioned in the centre of thesquare. The triangles are arranged fanning around the square so thateach of the eight triangles shares the centre vertex of the square.Alternative patterns, such as that shown in FIG. 12 and often seen inprior art, can also be used.

One advantage of the arrangement in FIG. 11 over that of FIG. 12 is thatthe triangles produced will be independent of the order of the originalpatch's control points. That is, swapping the definition of S and T inthe original patch, or reversing the order of the control points willproduce identical results. A second advantage is that it is closer inpattern to that generated when processing ‘irregular’ leaf patches.

Conversion from the leaf patch to the nine output vertex positions isaccomplished by a leaf patch tessellation process that can be carriedout within the weighting processor 20. The corresponding surface normalsfor these vertices are similarly computed in the direction processor 24.At this stage in the processing operation, the algorithm for minimizingpolygon popping is implemented.

FIG. 16 shows schematically the conversion from the control point dataof a regular patch to the nine vertices of the tessellating triangles.Assume that the 16 control points of the patch are arranged in a 4×4matrix with the points indexed Pij where j varies from 0 to 3 andindicates which row of the matrix the control point is located with row0 being the top row and i varies from 0 to 3 and indicates which columnof the matrix the control point is located with column 0 being the lefthand column. Assume also that the nine vertices of tessellatingtriangles are arranged in a 3×3 square with the top left vertex indexedV0 and the index incrementing clockwise around the 3×3 square to thecentre left vertex, V7, and the central vertex being indexed V8.

The four outer vertices of the tessellating triangles are deriveddirectly from the outer control points of the regular leaf patch. Thetop left vertex, V0, takes the value of the top left control point, P00,the top right vertex, V2, takes the value of the top right controlpoint, P30, the bottom left vertex, V6, takes the value of the bottomleft control point, P03, and the bottom right vertex, V4, takes thevalue of the bottom right control point, P33.

Generation of the remaining 5 vertices, V1, V3, V5, V7 and V8, isslightly more complex.

Consider the diagram of FIG. 17, where the curve can be considered to beone of the edges of the leaf patch, with points A and B being two of thecorner vertices, say V0 and V2. If a further subdivision were performed,this would yield a new point on the curve C, which would correspond to apossible position of the middle vertex, V1. Conversely, if the number ofsubdivisions were to remain the same, then the curve would beapproximated by the line AB, and V1 would lie on the line at point D. Inorder to achieve a smooth transition between points C and D as the levelof subdivision changes, a new point E is calculated along the line CD,and this is used as the value of V1. This is expressed in the followingequation:E=wC+(1−w)D  Equation 2

where w is the weight factor, derived from the fractional part of theedge subdivision ratio, D is a first vertex value derived at leaf-patchsubdivision level and C is a second vertex value derived at the sub-leafpatch subdivision level. (Note that the fractional part of the edgeratio is trivially obtained by examining the mantissa of a binaryfloating point representation of the value).

D is calculated by taking the mean of the two corner vertices; in thecase of FIG. 16, V0 and V2 correspond to points A and B respectively. Tocalculate C, a left half subdivision in s is performed and C takes thevalue of the top right control point of the left half subdivided patch.To calculate the value of C for the left(right) edge, the Bezier curvealong the left(right) edge of the leaf-patch is evaluated at t=½. Notethat this is identical to just computing Dn in FIG. 7. The calculationfor the ‘C’ point in the tope and bottom edges is analogous. Once thevalues of C (the second value) and D (the first value) have beencalculated, the vertex, V1, is calculated according to equation 2. Thiscalculation is performed by a combiner. The combiner may be an integralpart of the tessellation unit 20.

This calculation is repeated for each edge of the leaf patchquadrilateral. The centre point is calculated in a similar fashion,however the calculation of point C for V8 requires a subdivision in boththe s and t dimensions. This can be efficient done by using, say, the‘C’ values computed from the top and bottom edges, computing twoadditional ‘C’ values from the two centre rows of control points, andthen re-applying the method of these four values.

Because of the preferred tessellation pattern, i.e. shown in FIG. 11, inthe calculation of D for V8, one of the diagonal pairs of vertices,either (V0, V4) or (V2, V6) are used. The choice of which diagonal pairis based on the relative position of the leaf patch to the root patch.FIG. 18 a shows a chequer board arrangement showing the relativeposition of leaf patches to the root patch for 16 leaf patches. The leafpatch squares are arranged in four rows and four columns and cover theroot patch. Half the squares are shaded and the remaining squares areunshaded in an alternating pattern. The top left square is shaded.Referring to FIG. 18, the shaded leaf patches use (V0,V4) in thecalculation of point D whilst the calculation of D for the unshaded leafpatches uses (V2,V6). For other numbers of leaf patches, similardiagrams can be constructed applying the same patterning technique.

This preferred patterning scheme guarantees that as the subdivisionlevel ‘crosses a power of two boundary’, the arrangement of triangleswill not abruptly change. As the subdivision level is increased, any newtriangles created are guaranteed to ‘lie inside’ the parent triangles.This is shown in FIG. 18 b. For example, the introduced centre point inthe upper left leaf patch of the more highly tessellated region (shownon the right) would depend on the top-left to centre half-diagonal fromthe ‘parent’ leaf (on the left). Note that this is alternating operationwould not be necessary for the triangulation pattern shown in FIG. 12.

Irregular Patch Processing

Subdivision is terminated in any one direction, s or t, if either one ofthe relevant edge values lies between 1.0 and 2.0. Further processing ofthe leaf patch is required if it is irregular, that is if one or moreedges have an edge value which lies outside the range 1.0 to 2.0. Anirregular leaf patch may be considered to be a regular leaf patch whichrequires additional vertices on the edge whose subdivision value isoutside range to enable it to be joined to the adjacent patch. Theirregular leaf patch is first treated as a regular leaf patch and thenine vertices for the patch are calculated as described above. Tocalculate the additional vertices, further subdivision is performed. Thefurther subdivision may be carried out in the same subdivision unit assubdivision to form leaf-patches and may be controlled from the controlunit 22. The conversion of the fan patches to provide additionalvertices may be carried out in the converter for the leaf-patches or ina separate converter.

An example of subdivision processing for an irregular leaf patch with aright edge value outside the range 1.0 to 2.0 is shown in FIGS. 13 a and14. In this example, the right edge subdivision value would be between2.0 and 4.0 indicating that one additional level of subdivision isrequired to generate two extra vertices (V23 and V34) required on theright hand edge to prevent cracking. The additional vertices areprovided on the edge of the leaf patch whose edge value is outside the1.0 to 2.0 range; in this case the right hand edge. The trianglesdescribed by the additional vertices fan out from the centre vertex ofthe patch, splitting the original triangles spanning this edge in two.Thus, in the example, the right edge of the irregular patch has five(instead of three) vertices, namely V2, V23, V3, V34 and V4 in aclockwise direction, defining four triangles all with a common vertex atV8: V8-V2-V23, V8-V23-V3, V8-V3-V34 and V8-V34-V4.

V23 and V34 are calculated by performing further subdivisions in t untilthe right edge value is made to lie between 1.0 and 2.0 and by using theoutput of the additional subdivision to form a series of fan patcheswhich are used to generate the new vertices, V23 and V34. The fanpatches are not used in the calculation of the nine standard vertices,V0 to V8, corresponding to the vertices for a regular leaf-patch.

The processing required to generate the additional vertices for theirregular leaf-patch of FIGS. 13 a and 14 is described by way ofexample. By following the example, it will be clear to the skilled manhow to generate additional vertices for other types of irregular patch.

As the example has a right edge value in the range 2.0 to 4.0 it will beseen that only one level of subdivision will be required to bring theright edge value within the range 1.0 to 2.0. The irregular patchprocessing steps are summarised in the flow diagram of FIG. 15. The edgevalues of the irregular patch are tested to determine which edge valuesare outside the range 1.0 to 2.0. Processing proceeds on an edge-wisebasis. In the case of the example of FIGS. 13 a and 14, only the righthand edge value is outside the range. This indicates that onlysubdivision in t is required. The control unit 22 sends the appropriatecommand signal to the subdivision unit 18 to divide the irregular patchin t. The edge values of the fan patches are computes as described abovefor the appropriate general form of subdivision. The top and bottom halfsubpatches returned by 18 define upper and lower fan patches which maybe used to compute the additional vertices V23 and V24. The control unit22 maintains a history of the fan patch generation to ensure thegeneration of all appropriate fan patches. In this case, aftergeneration of a top half fan patch and a bottom half fan patch, all edgevalues are within the range 1.0 and 2.0 and no further subdivision toform fan patches is required.

The additional vertex V23 is obtained by calculating the centre rightvertex of the upper fan patch in accordance with equation 2 describedabove. The additional vertex V24 is calculated by estimating the centreright vertex of the lower fan patch in accordance with equation 2 above.

None of the other vertices of the fan patches are required in thetessellation process. The irregular leaf polygon data is generated bycombining the vertices generated by the normal subdivision process toform a leaf patch, the “first plurality of vertices'”, and theadditional vertices calculated from the fan patches, the “fan patchvalues'”.

Background to Calculation of the Direction of the Vertex Surface Normals

The direction processor takes the output of the subdivision unit 18 andcalculates the surface normal associated with each vertex. (Note that inthe preferred embodiment, the units 20 and 24 are separate but, in analternative embodiment, they could share a number of calculations thatthey have in common.) The surface normal is used to indicate thedirection that the surface being modelled is facing at the sample pointand is required for subsequent lighting and texturing calculations. Thedirection processor 24 calculates the normal for each vertex of the leafpatch including any additional vertices calculated from irregularpatches. To minimise the shading analog of polygon popping, the samelinear interpolation method as described previously by equation 2, isalso applied to the normals of interior vertices, i.e. the output normalmay be a blend of the neighbouring vertices' normals and the ‘correct’normal.

Note that, ideally, it is actually the final shading and texturingvalues that should be ‘blended’ . In the preferred embodiment this isnot done due to constraints imposed by external graphics standards (e.g.Microsoft's DirectX). To one skilled in the art it should be apparentthat the presented ‘polygon popping reduction’ method could easily beapplied after the vertex shading is computed should these constraints beremoved.

As known in the prior art, computation of surface normals can be simplerfor the four vertices located at the corners of non-rational Bezierpatches. An example of this has been shown in FIG. 19. The inventionadapts this principal for use with rational patches.

Since only four of the points initially lie at the corners of a leafpatch, the invention performs additional ‘partial’ subdivisions of theleaf. This processing is shown in FIG. 20. In the case of the ninevertices of a regular leaf patch (the numbering of which is that used inFIG. 11), three additional partial subdivisions (one in S (20(iii)), onein T (20(ii), and an additional subdivision (20(iv)) are sufficient toproduce child sub-patches such that positions of V1, V3, V5, V7 and V8,are at the corners of at least one sub-patch. Note that not all controlpoints of each sub-patch are needed to generate the vertex normals andin the preferred embodiment only the minimum required control points arecalculated. In FIG. 20, the control points which are needed (eitherdirectly for computation of a corner normal or for generation of therequired child patch's control points) are shown in grey or black, whilethose that aren't required are shown in white.

As stated, the invention computes the normals for rational Bezierpatches in an efficient manner, the method and reasoning behind whichwill now be presented.

The position of a rational surface at parameter location (s,t) (s,t) isgiven by:

${{\overset{\_}{B}}_{3D}\left( {s,t} \right)} = \frac{{\overset{\_}{B}}_{xyz}\left( {s,t} \right)}{B_{w}\left( {s,t} \right)}$

while the definition of the unit length tangent vector, at (0,0) in thedirection (a,b) is defined by:

${{\hat{T}}_{ab}\left( {0,0} \right)} = {\lim\limits_{e->0}\left( \frac{{{\overset{\_}{B}}_{3D}\left( {{ea},{eb}} \right)} - {{\overset{\_}{B}}_{3D}\left( {0,0} \right)}}{{{{\overset{\_}{B}}_{3D}\left( {{ea},{eb}} \right)} - {{\overset{\_}{B}}_{3D}\left( {0,0} \right)}}} \right)}$

Examining the “difference” terms in the expression we have . . .

${{{\overset{\_}{B}}_{3D}\left( {{ea},{eb}} \right)} - {{\overset{\_}{B}}_{3D}\left( {0,0} \right)}} = {\frac{{\overset{\_}{B}}_{xyz}\left( {{ea},{eb}} \right)}{w\left( {{ea},{eb}} \right)} - \frac{{\overset{\_}{B}}_{xyz}\left( {0,0} \right)}{w\left( {0,0} \right)}}$

. . . which implies . . .

Since the scalar value w(ea, eb)w(0,0) is positive and non-zero, it canbe applied to both top and bottom of the above limit equation giving:

$\begin{matrix}{{\hat{T}}_{ab}\left( {0,{0 = {\lim\limits_{e->0}\left( \frac{\begin{matrix}{{{{{\overset{\_}{B}}_{xyz}\left( {{ea},{eb}} \right)} \cdot w}\left( {0,0} \right)} -} \\{{{\overset{\_}{B}}_{xyz}\left( {0,0} \right)} \cdot {w\left( {{ea},{eb}} \right)}}\end{matrix}}{\begin{matrix}{{{{{\overset{\_}{B}}_{xyz}\left( {{ea},{eb}} \right)} \cdot w}\left( {0,0} \right)} -} \\{{{\overset{\_}{B}}_{xyz}\left( {0,0} \right)} \cdot {w\left( {{ea},{eb}} \right)}}\end{matrix}} \right)}}} \right)} & {{eqn}\mspace{20mu} 3}\end{matrix}$

Restricting our attention to rational Bezier parametric surfaces andnoting that the (0,0) (0,0) point of Bezier patch corresponds to the P₀₀ control point, we thus need to examine the behaviour of . . .B _(xyz)(ea,eb).P _(00w−) P _(00XYZ.) w(ea,eb).

For convenience, we will defineB _(Delta)(ea,eb)= B _(xyz)(ea,eb).P _(00w) − P _(00XYZ) .W(ea,eb).

In the preferred embodiment, the Bezier functions are bicubic.Extensions of this scheme to embodiments using surfaces of higher ordershould be straightforward to one skilled in the art.

We now express the bicubic homogenous Bezier surface (i.e. prior to thedivision of the x,y, and z components by the w component) at (ea,eb) inthe matrix form to obtain:

It can thus be seen that this can be expressed as:

$\begin{matrix}{{\overset{\_}{B}\left( {{ea},{eb}} \right)} = {\left( {\begin{bmatrix}{e^{3}a^{3}} & {e^{2}a^{2}} & {ea} & 0\end{bmatrix} + \begin{bmatrix}0 & 0 & 0 & 1\end{bmatrix}} \right){QPQ}^{T}}} \\{\left( {\begin{bmatrix}{e^{3}b^{3}} & {e^{2}b^{2}} & {eb} & 0\end{bmatrix}^{T} + \begin{bmatrix}0 & 0 & 0 & 1\end{bmatrix}^{T}} \right)} \\{= {{\begin{bmatrix}{e^{3}a^{3}} & {e^{2}a^{2}} & {ea} & 0\end{bmatrix}{{QPQ}^{T}\begin{bmatrix}{e^{3}b^{3}} & {e^{2}b^{2}} & {eb} & 0\end{bmatrix}}^{T}} +}} \\{\begin{bmatrix}0 & 0 & 0 & 1\end{bmatrix}{{QPQ}^{T}\begin{bmatrix}{e^{3}b^{3}} & {e^{2}b^{2}} & {eb} & 0\end{bmatrix}}^{T}} \\{{\begin{bmatrix}{e^{3}a^{3}} & {e^{2}a^{2}} & {ea} & 0\end{bmatrix}{{QPQ}^{T}\begin{bmatrix}0 & 0 & 0 & 1\end{bmatrix}}^{T}} +} \\{\begin{bmatrix}0 & 0 & 0 & 1\end{bmatrix}{{QPQ}^{T}\begin{bmatrix}0 & 0 & 0 & 1\end{bmatrix}}^{T}}\end{matrix}$

Noting the particular properties of the Q matrix, this simplifies to

${\overset{\_}{B}\left( {{ea},{eb}} \right)} = {{\left\lbrack \begin{matrix}{e^{3}a^{3}} & {e^{2}a^{2}} & {ea} & 0\end{matrix} \right\rbrack{{QPQ}^{T}\left\lbrack \begin{matrix}{e^{3}b^{3}} & {e^{2}b^{2}} & {eb} & 0\end{matrix} \right\rbrack}^{T}} + {\left\lbrack \begin{matrix}1 & 0 & 0 & 0\end{matrix} \right\rbrack{{PQ}^{T}\left\lbrack \begin{matrix}{e^{3}b^{3}} & {e^{2}b^{2}} & {eb} & 0\end{matrix} \right\rbrack}^{T}} + {\left\lbrack \begin{matrix}{e^{3}a^{3}} & {e^{2}a^{2}} & {ea} & 0\end{matrix} \right\rbrack{{QP}\left\lbrack \begin{matrix}1 & 0 & 0 & 0\end{matrix} \right\rbrack}^{T}} + P_{00}}$

which in turn reduces to . . .

${\overset{\_}{B}\left( {{ea},{eb}} \right)} = {{\begin{bmatrix}{e^{3}a^{3}} & {e^{2}a^{2}} & {ea} & 0\end{bmatrix}{{QPQ}^{T}\begin{bmatrix}{e^{3}b^{3}} & {e^{2}b^{2}} & {eb} & 0\end{bmatrix}}^{T}} + {P_{{top}\text{-}{row}}{Q^{T}\begin{bmatrix}{e\; 3b\; 3} & {e\; 2b\; 2} & {eb} & 0\end{bmatrix}}T} + {\begin{bmatrix}{e^{3}a^{3}} & {e^{2}a^{2}} & {ea} & 0\end{bmatrix}{QP}_{{left}\text{-}{column}}} + P_{00}}$

The invention's method computes up to three potential tangentcandidates, these being the ‘S’, ‘T’, and ‘diagonal’ tangent candidates.

Derivation of a candidate tangent vector in the ‘S’ direction:

If we consider the case of producing a tangent vector in the ‘S’direction, then equations 3 and 4 respectively reduce to:

${{\hat{T}}_{s}\left( {0,0} \right)} = {\lim\limits_{e->0}\left( \frac{B_{Delta}\left( {e,0} \right)}{{B_{Delta}\left( {e,0} \right)}} \right)}$

andB (e,0)=└e ³ e ² e0┘QP _(left-column) +P ₀₀

Examining B _(Delta)(e,0) we find:

$\begin{matrix}{{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)} = {{{{\overset{\_}{B}}_{xyz}\left( {e,0} \right)} \cdot P_{00w}} - {P_{00{xyz}} \cdot {w\left( {e,0} \right)}}}} \\{= {{\left( {{\begin{bmatrix}e^{3} & e^{2} & e & 0\end{bmatrix}{QP}_{{left}\text{-}{column}_{xyz}}} + P_{00{xyz}}} \right)P_{00w}} -}} \\{P_{00{xyz}}\left( {{\begin{bmatrix}e^{3} & e^{2} & e & 0\end{bmatrix}{QP}_{{left}\text{-}{column}_{w}}} + P_{00w}} \right)} \\{= {{\begin{bmatrix}e^{3} & e^{2} & e & 0\end{bmatrix}{{QP}_{{left}\text{-}{column}_{xyz}} \cdot P_{00w}}} -}} \\{{P_{00{xyz}}\begin{bmatrix}e^{3} & e^{2} & e & 0\end{bmatrix}}{QP}_{{left}\text{-}{column}_{w}}}\end{matrix}$

We now consider 3 cases:

$\begin{matrix}{{1.\mspace{20mu}{{\hat{T}}_{s}\left( {0,0} \right)}} = {{\lim\limits_{e->0}\left( \frac{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}{{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}} \right)} = {\lim\limits_{e->0}\left( \frac{\frac{1}{e} \cdot {{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}}{{\frac{1}{e} \cdot {{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}}} \right)}}} \\{{2.\mspace{20mu}{{\hat{T}}_{s}\left( {0,0} \right)}} = {{\lim\limits_{e->0}\left( \frac{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}{{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}} \right)} = {\lim\limits_{e->0}\left( \frac{\frac{1}{e^{2}} \cdot {{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}}{{\frac{1}{e^{2}} \cdot {{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}}} \right)}}} \\{{3.\mspace{20mu}{{\hat{T}}_{s}\left( {0,0} \right)}} = {{\lim\limits_{e->0}\left( \frac{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}{{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}} \right)} = {\lim\limits_{e->0}\left( \frac{\frac{1}{e^{3}} \cdot {{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}}{{\frac{1}{e^{3}} \cdot {{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}}} \right)}}}\end{matrix}$

For each of the above cases, from calculus it is known that if thelimits as e→0 of both the numerator and denominator exist (and the limitis non zero), then the limit of the entire expression exists).

Case 1: Starting with the numerator/denominator ‘contents’ we have

$\begin{matrix}{{\lim\limits_{e->0}{\frac{1}{e}{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}}} = {\lim\limits_{e->0}{\begin{bmatrix}e^{2} & e & 1 & 0\end{bmatrix}Q{{\overset{\_}{P}}_{{left}\text{-}{column}_{xyz}} \cdot}}}} \\{P_{00w} - {{{\overset{\_}{P}}_{00{xyz}}\begin{bmatrix}e^{2} & e & 1 & 0\end{bmatrix}}{QP}_{{left}\text{-}{column}_{w}}}} \\{= {\begin{bmatrix}0 & 0 & 1 & 0\end{bmatrix}Q{{\overset{\_}{P}}_{{left} - {column}_{\;{xyz}}} \cdot}}} \\{P_{00w} - {{{\overset{\_}{P}}_{00{xyz}}\begin{bmatrix}0 & 0 & 1 & 0\end{bmatrix}}{QP}_{{left}\text{-}{column}_{w}}}} \\{= {\begin{bmatrix}{- 3} & 3 & 0 & 0\end{bmatrix}{{\overset{\_}{P}}_{{left}\text{-}{column}_{xyz}} \cdot}}} \\{P_{00w} - {{{\overset{\_}{P}}_{00{xyz}}\begin{bmatrix}{- 3} & 3 & 0 & 0\end{bmatrix}}{QP}_{{left}\text{-}{column}_{w}}}} \\{= {3\left( {{\left( {{\overset{\_}{P}}_{10_{xyz}} - {\overset{\_}{P}}_{00_{xyz}}} \right) \cdot P_{00w}} - {{\overset{\_}{P}}_{00{xyz}}\left( {P_{10_{w}} - P_{00_{w}}} \right)}} \right)}} \\{= {3\left( {{{\overset{\_}{P}}_{10_{xyz}}P_{00w}} - {{\overset{\_}{P}}_{00{xyz}}P_{10_{w}}}} \right)}}\end{matrix}$

The limit clearly exists and will be non-zero if and only if P ₁₀ _(xyz)P_(00w)≠P_(00xyz)P₁₀ _(w) . If this condition holds then a tangentvector in the direction S is given by T _(S1)= P ₁₀ _(xyz)P_(00w)≠P_(00xyz)P₁₀ _(w) . Note that the length of the vector isimmaterial at this point.

Case 2: if the condition of case 1 is not met, (i.e. P ₁₀ _(xyz)P_(00w)≠P_(00xyz)P₁₀ _(w) ), then the limits of the second case areexamined. This gives:

${\lim\limits_{e->0}{\frac{1}{e^{2}}{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}}} = {\lim\limits_{e->0}{\frac{1}{e}\left( {{\overset{\_}{B}}_{Delta}\left( {e,0} \right)} \right)}}$

Noting that . . .

$\begin{matrix}{{\frac{1}{e}{{\overset{\_}{B}}_{Delta}\left( {e,0} \right)}} = {\begin{bmatrix}e^{2} & e & 1 & 0\end{bmatrix}Q{{\overset{\_}{P}}_{{left\_ column}_{xyz}} \cdot}}} \\{P_{00w} - {{{\overset{\_}{P}}_{00{xyz}}\begin{bmatrix}e^{2} & e & 1 & 0\end{bmatrix}}{QP}_{{left\_ column}_{w}}}} \\{= {\begin{bmatrix}e^{2} & e & 0 & 0\end{bmatrix}Q{{\overset{\_}{P}}_{{left\_ column}_{xyz}} \cdot}}} \\{P_{00\; w} - {{{\overset{\_}{P}}_{00\;{xyz}}\begin{bmatrix}e^{2} & e & 0 & 0\end{bmatrix}}{QP}_{{left\_ column}_{w}}} +} \\{\begin{bmatrix}0 & 0 & 1 & 0\end{bmatrix}Q{{\overset{\_}{P}}_{{left\_ column}_{xyz}} \cdot}} \\{P_{00w} - {{{\overset{\_}{P}}_{00{xyz}}\begin{bmatrix}0 & 0 & 1 & 0\end{bmatrix}}{QP}_{{left\_ column}_{w}}}}\end{matrix}$

. . . we see that the second part of the sum is the same as the resultfrom case 1, which have assumed to be zero. We thus get

$\begin{matrix}{{\lim\limits_{e->0}{\frac{1}{e^{2}}{B_{Delta}\left( {e,0} \right)}}} = {\lim\limits_{e->0}{{\frac{1}{e}\begin{bmatrix}e^{2} & e & 0 & 0\end{bmatrix}}Q{{\overset{\_}{P}}_{{left\_ column}_{xyz}} \cdot}}}} \\{P_{00w} - {{{\overset{\_}{P}}_{00{xyz}}\begin{bmatrix}e^{2} & e & 0 & 0\end{bmatrix}}{QP}_{{left\_ column}_{w}}}} \\{= {\lim\limits_{e->0}{{\frac{1}{e}\begin{bmatrix}e & e & 0 & 0\end{bmatrix}}Q{{\overset{\_}{P}}_{{left\_ column}_{xyz}} \cdot}}}} \\{P_{00w} - {{{\overset{\_}{P}}_{00{xyz}}\begin{bmatrix}e & e & 0 & 0\end{bmatrix}}{QP}_{{left\_ column}_{w}}}} \\{= {\begin{bmatrix}0 & 1 & 0 & 0\end{bmatrix}Q{{\overset{\_}{P}}_{{left\_ column}_{xyz}} \cdot}}} \\{P_{00w} - {{{\overset{\_}{P}}_{00{xyz}}\begin{bmatrix}0 & 1 & 0 & 0\end{bmatrix}}{QP}_{{left\_ column}_{w}}}} \\{= {{\begin{bmatrix}3 & {- 6} & 3 & 0\end{bmatrix}{{\overset{\_}{P}}_{{left\_ column}_{xyz}} \cdot P_{00w}}} -}} \\{{{\overset{\_}{P}}_{00{xyz}}\begin{bmatrix}3 & {- 6} & 3 & 0\end{bmatrix}}P_{{left\_ column}_{w}}} \\{= {{\left( {{3{\overset{\_}{P}}_{20_{xyz}}} - {6{\overset{\_}{P}}_{10_{xyz}}} + {3{\overset{\_}{P}}_{00_{xyz}}}} \right)P_{00w}} -}} \\{{\overset{\_}{P}}_{00{xyz}}\left( {{3{\overset{\_}{P}}_{20_{w}}} - {6{\overset{\_}{P}}_{10_{xyz}}} + {3{\overset{\_}{P}}_{00_{xyz}}}} \right)} \\{= {{\left( {{3{\overset{\_}{P}}_{20_{xyz}}} + {3{\overset{\_}{P}}_{00_{xyz}}}} \right)P_{00w}} -}} \\{{{\overset{\_}{P}}_{00{xyz}}\left( {{3{\overset{\_}{P}}_{20_{w}}} + {3{\overset{\_}{P}}_{00_{xyz}}}} \right)} -} \\{6\left( {{{\overset{\_}{P}}_{10_{xyz}}P_{00w}} - {{\overset{\_}{P}}_{00{xyz}}{\overset{\_}{P}}_{10_{w}}}} \right)}\end{matrix}$

Again we have assumed P ₁₀ _(xyz) P_(00w)= P _(00xyz)P₁₀ _(w) and sothis becomes

$\begin{matrix}{= {{\left( {{3{\overset{\_}{P}}_{20_{xyz}}} + {3{\overset{\_}{P}}_{00_{xyz}}}} \right) \cdot P_{00w}} - {{\overset{\_}{P}}_{00{xyz}}\left( {{3{\overset{\_}{P}}_{20_{w}}} + {3{\overset{\_}{P}}_{00_{w}}}} \right)}}} \\{= {3\left( {{{\overset{\_}{P}}_{20_{xyz}}P_{00w}} - {{\overset{\_}{P}}_{00{xyz}}{\overset{\_}{P}}_{20_{w}}}} \right)}}\end{matrix}$

Thus if the chosen conditions hold, there is a valid ‘S’ tangent T_(s3)= P ₃₀ _(yxz) P_(00w)− P _(00xyz) P ₃₀ _(w) if this is non-zero.

Case 3:

Should both cases 2 and 3 fail, then using a similar argument to thesepresented, an “S” may be computed from T _(s3)= P ₃₀ _(xyz) P_(00w)− P_(00xyz) P ₃₀ _(w) provided that is non-zero.

Derivation of a candidate tangent vector in the ‘T’ direction:

This follows exactly the same reasoning as for the “S” tangent, and sowill not be discussed here.

Derivation of a candidate tangent vector in the ‘diagonal’ direction:

If the T _(Sα) and T _(Tβ) candidate tangent are linearly dependent thenby themselves they are not suitable for generating the normal vector. Inthis case it is necessary to manufacture another tangent candidate,which will be referred to as the ‘diagonal’ tangent candidate.

For the purposes of the preferred embodiment, it is assumed that atleast one of T _(Sα) or T _(Tβ) is non-zero—the first non-zero choicewill be called T _(NZ). Under these conditions, a ‘diagonal’ tangentvector candidate will be chosen to the T _(diag)= P ₁₁ _(xyz) P_(00w)− P_(00xyz) P ₁₁ _(w) . The mathematics behind this choice is somewhat moreinvolved, and so will not be presented here.

It should now be clear that with the above method, up to eight controlpoints may be required for the computation of a particular cornervertex's normal. FIG. 21 illustrates the set for the case of the V0(i.e. (s,t)=(0,0)) corner vertex. Because the choice of control pointswill change depending on the vertex normal being calculated, a differentnomenclature will be employed for the remainder of the discussion. Thecontrol points used for the calculation of a particular vertex normalwill be called C, S₁, S₂, S₃, T₁, T₂, T₃, and D. As an example, thecorrespondence between this naming scheme and the required controlvertices for vertex V0 is also shown in FIG. 21.

Preferred embodiment of “Surface Normal generation unit” The surfacenormal generation unit, 24, is now explained with reference to FIG. 22a.

The leaf patch's control points are supplied, 200, and for each of theV0, V2, V4, and V6 vertices the correct set of 8 control points (C, S₁,S₂, S₃, T₁, T₂, T₃, D) are selected, 201, and supplied in turn to thecorner normal unit, 202. Note that only the X, Y, Z, and W components ofthe control points are required in the surface normal generation unit.

Unit 201 is a MUX that chooses which of the original leaf patch controlpoints correspond to each of the four sets of 8 points. In the preferredembodiment, the four selections are as follows:

Vertex V0: This is shown in FIG. 21.C=P₃₀{=V2} D=P₂₁S₁=P₃₁ S₂=P₃₂ S₃=P₃₃T₁=P₂₀ T₂=P₁₀ T₃=P₀₀  v2:C=P₃₃{=V4} D=P₂₂S₁=P₂₃ S₂=P₁₃ S₃=P₃ andT₁=P₃₂ T₂=P₃₁ T₃=P₃₀  v4:C=P₀₃{=V6} D=P₁₂S ₁=P₀₂ S₂=P₀₁ S₃=P₀₀T₁=P₁₃ T₂=P₂₃ T₃=P₃₃  v6:

It should be noted that, in the preferred embodiment, the orientation ofthe ‘virtual’ S, T, and diagonal tangent candidates rotates by 90° witheach successive corner vertex. This is done to maintain a consistentorientation of the surface normal.

In an alternative embodiment, selection of the control points bymirroring of the existing axis directions could be used but this wouldrequire an additional flag to be supplied to unit ‘202’ to indicate ifthe result of the cross products should be negated. Such a negationwould have to be indicated for at least vertices V2 and V6. (Vertex V4would need no negation as both axes would have been flipped).

Unit 203 performs a partial subdivision of the leaf patch in order tocompute new control points suitable for the generation of surfacenormals for vertices V1 and V5. The set required has been illustrated inFIG. 20 (ii). Unit 204 is another multiplexor which selects the requiredpoints for each of V1 and V5 respectively and supplied them to thecorner normal unit, 202. The selection process is analogous to that ofunit 201 and should be obvious to one skilled in the art given theprevious description.

In a similar fashion, units 205 and 206 produce the two sets of controlpoints needed for the normals of vertices V3 and V7 (see FIG. 20 (iii).

Units 207 and 208 produce the set of eight control points needed togenerate the surface normal for V8. This set is illustrated in FIG. 20(iv). Note that the four control points shown on the right edge of FIG.20 (iv) can be obtained by a single subdivision of the right edge ofFIG. 20 (ii), while the bottom edge is computed from a singlesubdivision of the bottom edge of FIG. 20 (iii) The control pointcorresponding to “D” can be obtained from either the second bottom rowof FIG. 20 (iii) or alternatively from the second right most column of20 (ii)

For performance reasons, a preferred embodiment overlaps the calculationof several vertex normals via a combination of multiple units and apipelined architecture. In alternative embodiments, the level ofparallelism could be varied as a cost/performance trade-off.

The “corner normal unit”, 202, is now discussed with reference to FIG.22 b. Note that for clarity, this figure only describes the computationof a single normal. The eight chosen control points are input, 220. TheC point and three S points are sent to the “S Candidate” computationunit, 221, C and three T points are sent to the “T Candidate”computation unit, 222, while C and D are sent to the “DiagonalCandidate” unit. The three computed tangent candidates, T_(S), T_(T),and T_(Diag), are then input into ‘candidate selection and normalcalculation’ unit, 224.

The function of 221 will now be described with reference to theflowchart in FIG. 23. Although not explicitly shown in this figure, thepreferred embodiment uses a pipelined architecture to compute each ofthe products, such as S₁ _(XYZ) C_(W) or S₂ _(W) C_(XYZ),“simultaneously”. Similarly, the comparison operations are also carriedout in a pipelined fashion. At step 240, the first two products, S₁_(XYZ) C_(W) and C_(XYZ)S₁ _(W) are compared. (Those familiar withfloating point arithmetic will appreciate that equality tests aresimpler than subtraction). If these products are not equal then theT_(S) tangent vector is computed in step 241 by taking the difference ofthe two. If, on the other hand, the two products are equal, then thenext pair of products, S₂ _(XYZ) C_(W) and C_(XYZ)S₂ _(W) are compared,242. If these differ, T_(S) is set to be the difference of the pair,243. Instead, if the products were identical, then the final pair ofproducts, S₃ _(XYZ) C_(W) and C_(XYX)S_(3W), are compared, 244, and ifdifferent, T_(S), is computed, while if they are identical, then thetangent is marked as being zero.

In an alternative embodiment an additional ‘optimisation’ can beincluded to initially test if the w or ‘weight’ component values areidentical before optionally performing the multiplication. This couldpotentially reduce the computation delay for cases where the patches arenon-rational, i.e. where the w values are constant.

It should thus be noted that only one vector subtract unit is requiredand in the preferred embodiment, this is pipelined. In alternativeembodiments, the subtract unit could also be shared with units 222 and223.

Unit 222 is similar to that 221 except that it computes T_(T), whileunit 223 simply calculates T_(Diag)=D_(XYZ)C_(W)−C_(XYZ)D_(W).

Unit 224 is now described with reference to FIG. 24. Tests 250 and 252check for the special cases where either T_(S) or T_(T) may be a zerovector, and set in intermediate vector, T_(NZ), to be either −T_(T)(251) or T_(S) (253) respectively. If both vectors are non-zero, then acandidate surface normal is produced in step 254 by taking the vectorcross product of T_(S) and T_(T). The candidate normal is then comparedagainst zero, 255. If it is not zero, then it is used as the surfacenormal, 256. If it is zero, then the intermediate vector is set in step253.

If the intermediate vector was required, then the alternative normalcalculation is employed, 257. This computes the cross product of theintermediate vector and the diagonal tangent candidate. Note that instep 251, T_(NZ) was sent to be the negative of T_(T). This is done tomaintain consistency of the normal orientation. It should be appreciatedthat negation of floating point values is trivial.

As stated earlier, the normals thus calculated for vertices V1, V3, V5,V7, and V8 represent those at the maximum fractional subdivision levelwithin the leaf patch. For the smaller fractional levels, the sameblending process used to eliminate polygon popping is also applied toproduce the final normal vector results. Similarly, the calculation ofnormals for irregular leaf patches must undergo extra levels ofsubdivision akin to that previously described.

It should thus be appreciated that the invention computes the surfacenormals for rational Bezier surfaces without requiring expensivedivision operations. This is a significant saving. With the preferredembodiment, the normals that are output are not unit vectors—with thepreferred embodiment it is assumed that the subsequent shading andtransformation units, which are not described in the document, will becapable of performing this simple-task if required.

Returning to FIG. 6, the final stage of the pipelined tessellationprocess is performed in the output buffer 26. The input buffer 12 tookthe control point grouped data and regrouped the data by element. Theoutput buffer 26 is required to perform the reverse task of grouping thedata from the calculation stages by vertex. The output buffer 26 takesthe vertices calculated by the weighting processor 20 and the normalscalculated by the direction processor 24, groups together the data foreach element by vertex and outputs it for subsequent use in thetransformation, lighting, texturing and rasterization of the image fordisplay.

It should be noted that the features described by reference toparticular figures and at different points of the description may beused in combinations other than those particularly described or shown.All such modifications are encompassed within the scope of the inventionas set forth in the following claims.

With respect to the above description, it is to be realized thatequivalent apparatus and methods are deemed readily apparent to oneskilled in the art, and all equivalent apparatus and methods to thoseillustrated in the drawings and described in the specification areintended to be encompassed by the present invention. Therefore, theforegoing is considered as illustrative only of the principles of theinvention. Further, since numerous modifications and changes willreadily occur to those skilled in the art, it is not desired to limitthe invention to the exact construction and operation shown anddescribed, and accordingly, all suitable modifications and equivalentsmay be resorted to, falling within the scope of the invention.

For example, alternative patterns of tessellating triangles areconsidered to fall within the scope of the invention.

1. An interface for use in a 3-d graphics system comprising a parametricmodelling unit for modelling objects as high order surfaces and apolygon based rendering system for rendering polygon modelled objectsfor display, the interface comprising: a) an input, for receiving datarepresenting at least one high order surface patch; b) a subdivisionunit, coupled to the input, for processing the data to form leaf patchdata representing the patch at a first level of subdivision and forfurther processing the data to form sub-leaf patch data representing thepatch at a second level of subdivision; c) a converter, coupled to thesubdivision unit, for determining from the leaf patch data a firstplurality of values representing vertices of tessellating polygonsdescribing the leaf patch, and for determining from the sub-leaf patchdata a second plurality of values representing the vertices oftessellating polygons describing the sub-leaf patch; d) a combiner,coupled to the converter, for combining the first and second pluralityof values to form leaf polygon data defining the polygon vertices at thefirst subdivision level, wherein the combiner is a weighting processorfor performing a weighted average of the first and second plurality ofvalues; and e) an output, coupled to the combiner, for outputting theleaf polygon data.
 2. An interface according to claim 1, furthercomprising a control unit, coupled to the subdivision unit and to theweighting processor, for controlling processing of the data by thesubdivision unit and for generating a fractional value, w, for use bythe weighting processor in the weighted average of the first and secondplurality of values.
 3. A method of interfacing between a parametricmodelling unit and a polygon based rendering system in a 3-d graphicssystems, the method comprising the steps of a) receiving datarepresenting at least one high order surface patch; b) processing thedata to form leaf patch data representing the patch at a first level ofsubdivision; c) determining from the leaf patch data a first pluralityof values representing the vertices of a plurality of tessellatingpolygons describing the leaf patch; d) further processing the data toform sub-leaf patch data representing the patch at a second level ofsubdivision e) determining from the sub-leaf patch data a secondplurality of values representing the vertices of the plurality oftessellating polygons describing the sub-leaf patch; f) combining thefirst and second plurality of values to form leaf polygon data definingthe polygon vertices at the first subdivision level, wherein thecombination of the first and second plurality of values is a weightedaverage; and g) outputting the leaf polygon data.
 4. A method accordingto claim 3, wherein processing the data in step (d) requires a singlelevel of subdivision of the leaf patch data.
 5. A method according toclaim 3, further comprising the step of controlling the processing ofdata by the subdivision unit and generating a fractional value, w, foruse in the weighted average.
 6. An interface for a 3-d graphics systemcomprising a parametric modelling unit and a polygon based renderingsystem, the interface comprising: a) an input for receiving datarepresenting at least one high order surface patch, patch subdivisiondata representing a first level of subdivision required for the patch,and edge subdivision data representing a second level of subdivisionrequired for at least one edge of the patch; b) a subdivision unit,coupled to the input, for processing the data to form leaf patch datarepresenting the patch at the first level of subdivision and furtherprocessing the data to form fan patch data representing the patch at thesecond level of subdivision; c) a converter, coupled to the subdivisionunit, for determining from the leaf patch data a first plurality ofvalues representing the vertices of tessellating polygons describing theleaf patch and for determining from the fan patch data fan patch valuesrepresenting vertices of additional tessellating polygons to thoserepresented by the first plurality of values further describing the leafpatch; d) a combiner, coupled to the converter, for combining the firstplurality of values and the fan patch values to form irregular leafpolygon data defining the vertices of an irregular pattern oftessellating polygons at the first subdivision level, wherein thecombiner is a weighting processor for performing a weighted average ofthe first plurality of values and the fan patch values; and e) anoutput, coupled to the combiner, for outputting the irregular leafpolygon data.
 7. An interface according to claim 6, further comprising acontrol unit, coupled to the subdivision unit, for controlling theprocessing of the data by the subdivision unit to subdivide the patch ina first direction to the required level in the first direction and tosubsequently subdivide the patch in a second direction to the requiredlevel in the second direction.
 8. A method of interfacing between aparametric modelling unit and a polygon based rendering system in a 3-dgraphics system, the method comprising the steps of: a) receiving datarepresenting at least one high order surface patch, patch subdivisiondata representing a first level of subdivision required for the patch,and edge subdivision data representing a second level of subdivisionrequired for at least one edge of the patch; b) processing the data toform leaf patch data representing the patch at the first level ofsubdivision; c) determining from the leaf patch data a first pluralityof values representing the vertices of tessellating polygons describingthe leaf patch; d) further processing the data to form fan patch datarepresenting the patch at the second level of subdivision; e)determining from the fan patch data fan patch values representingvertices of additional tessellating polygons to those represented by thefirst plurality of values, the additional tessellating polygons furtherdescribing the leaf patch; f) combining the first plurality of valuesand the fan patch values to form irregular leaf polygon data definingthe vertices of an irregular pattern of tessellating polygons at thefirst subdivision level, wherein the combination of the first pluralityof values and the fan patch values is a weighted average; and g)outputting the irregular leaf polygon data.
 9. A method according toclaim 8, further comprising the step of controlling the processing ofthe data by the subdivision unit to subdivide the patch in a firstdirection to the required level in the first direction and tosubsequently subdivide the patch in a second direction to the requiredlevel in the second direction.
 10. An interface for a 3-d graphicssystem comprising a parametric modelling unit and a polygon basedrendering system, the interface comprising: a) an input for receivingdata representing at least one high order surface patch; b) an inputmultiplexer, coupled to the input, for rearranging the data; c) asubdivision unit, coupled to the input multiplexor, for processing thedata to form interim data representing one portion of the patch at alevel of subdivision in a first subdivision direction; d) an outputmultiplexer, coupled to the subdivision unit, for arranging the interimdata to form leaf patch data representing the required portion of thepatch in the required direction at the level of subdivision; e) acontrol unit, coupled to the input multiplexor and to the outputmultiplexor, for controlling the rearrangement of the data and thearrangement of the interim data to allow generation of the requiredportion of the patch in the required direction; f) a polygonisationprocessor, coupled to the output multiplexor, for determining leafpolygon data representing the vertices of tessellating polygonsdescribing the required portion of the patch at the level of subdivisionin the required direction; and g) an output, coupled to thepolygonisation processor, for outputting the leaf polygon data.
 11. Aninterface according to claim 10, wherein the subdivision unit comprisesfour subcalculation units, coupled in parallel to the input and outputmultiplexers and to the control unit, each subcalculation unitprocessing a quarter of the data to form a quarter of the interim dataand wherein the control unit selects from the data the quarter of datafor processing by each subcalculation unit.
 12. An interface accordingto claim 11, wherein each subdivision unit comprises: a) a firstcalculation stage, coupled to the input multiplexor for receiving datacomprising four values A^(n−1), B^(n−1), C^(n−1) and D^(n−1) and coupledto second and fourth calculation stages, the first calculation stagecomprising three adders for performing in parallel the additions:P=A ^(n−1) +B ^(n−1);Q=B ^(n−1) +C ^(n−1);R=C ^(n−1) +D ^(n−1); and for outputting P to the fourth calculationstage and P, Q and R to the second calculation stage; b) the secondcalculation stage, coupled to the first, and fourth calculation stagesand to a third calculation stage, comprising two adders for performingin parallel the additions:S=P+Q;T=Q+R; and for outputting S to the fourth calculation stage and S and Tto the third calculation stage; c) the third calculation stage, coupledto the second and fourth calculation stages, comprising one adder forperforming the addition:U=S+T; and for outputting U to the fourth calculation stage; d) thefourth calculation stage comprising three dividers for performing inparallel the divisions:V=P/2;W=S/4;X=U/8; and for outputting V, W and X to an output; and e) an output,coupled to the first and fourth calculation stages and to the outputmultiplexor of the subdivision unit, for outputting the quarter interimdata A^(n)=A^(n−1), B^(n)=V, C^(n)=W and D^(n)=X.
 13. An interfaceaccording to claim 10, further comprising a recursion buffer coupled tothe input multiplexer and to the output multiplexer for storing datarepresenting a root patch and processed data.
 14. A method ofinterfacing between a parametric modelling unit and a polygon basedrendering system in a 3-d graphics system, the method comprising thesteps of: a) receiving data representing at least one high order surfacepatch; b) rearranging and separating the data into quarters; c)processing the four quarters of data in parallel and then assembling thefour quarters of data to form interim data representing one portion ofthe patch at a level of subdivision in a first subdivision direction; d)arranging the interim data to form leaf patch data representing therequired portion of the patch in the required direction at the level ofsubdivision; e) wherein the steps of rearranging of the data andarranging of the interim data are controlled to generate the requiredportion of the patch in the required direction; f) determining leafpolygon data representing the vertices of tessellating polygonsdescribing the required portion of the patch at the level of subdivisionin the required direction; and g) outputting the leaf polygon data. 15.A method according to claim 14, wherein the processing in eachsubdivision unit comprises the steps of: a) receiving data comprisingfour values A^(n−1), B^(n−1), C⁻¹ and D^(n−1), performing in parallelthe additions:P=A ^(n−1) +B ^(n−1);Q=B ^(n−1) +C ^(n−1);R=C ^(n−1) +D ^(n−1); b) performing in parallel the additions:S=P+Q;T=Q+R; c) performing the addition:U=S+T; d) performing in parallel the divisions:V=P/2;W=S/4;X=U/8; and e) outputting the quarter interim data A^(n)=A^(n−1),B^(n)=V, C^(n)=W and D^(n)=X.
 16. A method according to claim 15,further comprising the step of storing data representing a root patchand processed data for reducing the processing time.